﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SampleWebApplication
{
    public partial class Delete : System.Web.UI.Page
    {
        Db_connect db = new Db_connect();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
          int _id=  Convert.ToInt32(DropDownList1.SelectedItem.Text);
          String delete_query = "delete from dbo.customer where id='" + _id + "'";


          try
          {
              
              bool check= db.insertDeleteUpdateValues(delete_query);
              if(check)
              Label1.Text ="Delete Complete";
              Response.Redirect("WebForm1.aspx");
          }
          catch (Exception ex)
          {
              Label1.Text = ex.Message;
          }

        }
    }
}